execute as @a[advancements={dab:bow_charged=false}] at @s if entity @s[tag=!Charging] run scoreboard players reset @s Charge_longbow_using
execute as @a[tag=SelfProtect] at @s run tag @s remove SelfProtect
execute as @a at @s if score @s Charge_longbow_using matches 1.. anchored eyes positioned ^ ^ ^ run function dab:system/bow_arrow/charge_longbow/charge_arrow/shoot

execute as @a[advancements={dab:bow_charged=true}] at @s if entity @s[tag=Charging] run tag @s remove Charging
execute as @a[advancements={dab:bow_charged=true}] at @s if entity @s[tag=!Charging] run advancement revoke @s only dab:bow_charged